#include "test_ssl.h"
#include "cm_uart.h"
#include "cm_demo_uart.h"
unsigned char *test_serve_ca = 
"-----BEGIN CERTIFICATE-----\r\n" \
"MIIF/jCCBOagAwIBAgIQAwI4KFIUPD9m7gb9AGBz8jANBgkqhkiG9w0BAQsFADBu\r\n" \
"MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3\r\n" \
"d3cuZGlnaWNlcnQuY29tMS0wKwYDVQQDEyRFbmNyeXB0aW9uIEV2ZXJ5d2hlcmUg\r\n" \
"RFYgVExTIENBIC0gRzEwHhcNMjIwNzIxMDAwMDAwWhcNMjMwNzIyMjM1OTU5WjAZ\r\n" \
"MRcwFQYDVQQDEw53d3cuc3N3d2RkLnRvcDCCASIwDQYJKoZIhvcNAQEBBQADggEP\r\n" \
"ADCCAQoCggEBANaw/8CQM9tL3U2g0hUb/32wni4L/dvc/MA+HFTsatJgQsiJH06Y\r\n" \
"H2lVnW7w/4UOMrVIqU7ZaQ6qPx3o13WEXmhxoN55ZqYRfkWmd67jaWvjgjNi2GMY\r\n" \
"swQzDgwHkOI2TY837jvgjAAUgirC8DrzlKbEtyUdNUhrvDJR3MZ1nD7JlgYDHzI6\r\n" \
"Utr8It5A2KSGTDLEOYthpgOFNaluGqzB33O+/Y9mD943af7gvxj8WPr3vV0/oe0x\r\n" \
"16c/frLXbbFBkdeMOKG1Up37kSPMrwXB8fAGNi3H08F195Sl2QAkFRUwqh5gc/Nx\r\n" \
"wJzOGID8lGbKK6DZDucJt0WM3kaqyldtyGMCAwEAAaOCAuswggLnMB8GA1UdIwQY\r\n" \
"MBaAFFV0T7JyT/VgulDR1+ZRXJoBhxrXMB0GA1UdDgQWBBRg8Ld5jqWrJl15IOa0\r\n" \
"q9AWxUy3NTAlBgNVHREEHjAcgg53d3cuc3N3d2RkLnRvcIIKc3N3d2RkLnRvcDAO\r\n" \
"BgNVHQ8BAf8EBAMCBaAwHQYDVR0lBBYwFAYIKwYBB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e4LkxOn2ouD7OPijjw7U1fYs4Eo0Yd6N4Y\r\n" \
"D0y3DBO6naSUVg9phlP5lp0E/Sp3l5G9AQL4r0RNapnGe+84QXr0kTbE+zRv1KoL\r\n" \
"f1rSit14cuiBa6kjkIy5oVnY7H1/B3yuKmP8b6kCgYAMsFZhcgjlciwsDSZUUOGN\r\n" \
"Pz+pa7s8a0Ag9UfkqF0rowGLsLpb9x1ZMNwzksivgeTVyfovwSU23Ly6flzJBrCi\r\n" \
"rIbVUyEYvaQiOEB+dGKPrR0wQ4KnR8Oa4kcpfDshoEo7c+JooAeauCG1JZwWMvn1\r\n" \
"5OfUezsSbRX/2TMqF7/X2wKBgAbXnEny4GveC5ICFoaX7MMg+iRhU39ux6xuJMy0\r\n" \
"rkLD8ZmltFTPv5r2LYIMABMC7Y3D1qYrcw1aVBfz+HfSVSzN01sBnBU0TLQZ4/Vz\r\n" \
"HUOBcpRfJNPaOju4VIVuWqemE9JiVqdqsmOH0ehrHRW5GRW5fVPtVBjTNLGMDnXd\r\n" \
"1hG5AoGBAJ+CqPIhKecas63v+jmTCyaYWRoUo303y1E9uWWp3wfpVkhCaqnx1uId\r\n" \
"0xEHczVeCpoU24oG5eb0pjPuR/nwxYrncRKLFCtkRt8L9gG0O7I5rbsiHWdRkADt\r\n" \
"+FMUjoL3EQWbM9m7TVxWVZapAiPoJtyClmsXzjKaj5vHt+0xotQB\r\n" \
"-----END RSA PRIVATE KEY-----\r\n";


ssl_ctx cm_ssl_ctx_p;
int con_flag = 0;
extern int socket_arr[4];
void cm_test_ssl_operation(unsigned char*cmd[],int len)
{
    if(0 == strncmp("SETOPT",cmd[2],strlen("SETOPT")))
    {
        int32_t ssl_id = atoi(cmd[3]);
        cm_ssl_param_type_e type = atoi(cmd[4]);
        void * value = NULL;
        uint16_t tmp_value = 0;
        if (CM_SSL_PARAM_VERIFY == type || CM_SSL_PARAM_NEGOTIME == type)
        {
            tmp_value = atoi(cmd[5]);
            value = &tmp_value;
        }else 
        {
            if(CM_SSL_PARAM_CA_CERT == type)
            {
                value = test_serve_ca;
            }else if(CM_SSL_PARAM_CLI_CERT == type)
            {
                value = test_client_ca;
            }else if(CM_SSL_PARAM_CLI_KEY == type)
            {
                value = test_client_key;
            }
            else if(CM_SSL_PARAM_CA_CERT_DELETE == type)
            {
                
            }else if(CM_SSL_PARAM_CLI_CERT_DELETE == type)
            {
                
            }else if(CM_SSL_PARAM_CLI_KEY_DELETE == type)
            {
                
            }
            else{
                cm_demo_printf("param error!\n");
            }
            
        }
        int32_t ssl_setopt = cm_ssl_setopt(ssl_id,type,value);
        cm_demo_printf("cm_ssl_setopt ret:%d\n",ssl_setopt);
        OCTEST_FUNC_EXPECT_EQUAL_INT32(0,ssl_setopt,cm_ssl_setopt);
    }
    else if(0 == strcmp("CONNECT",cmd[2]))
    {
        int ssl_id = atoi(cmd[3]);
        int socket = -1;
        if (0 == strcmp(cmd[0],"suite"))
        {
            socket = socket_arr[0];
        }
        else if (0 == strcmp(cmd[0],"CM"))
        {
            socket = atoi(cmd[4]);
        }
        int timeout = atoi(cmd[5]);
        con_flag = 1;
        int ret = cm_ssl_conn(&cm_ssl_ctx_p,ssl_id,socket,timeout);
        cm_demo_printf("cm_ssl_conn ret:%d\n",ret);
        OCTEST_FUNC_EXPECT_EQUAL_INT32(0,ret,cm_ssl_conn);
        //con_flag = 0;
    }
    else if(0 == strcmp("CLOSE",cmd[2]))
    {
        cm_demo_printf("cm_ssl_close no ret.\n");
        cm_ssl_close(&cm_ssl_ctx_p);
        int sock = 0;
        if (0 == strcmp(cmd[0],"suite"))
        {
            sock = socket_arr[0];
        }
        else if (0 == strcmp(cmd[0],"CM"))
        {
            sock = atoi(cmd[3]);
        }
        int close_ret = cm_asocket_close(sock);
        cm_demo_printf("cm_asocket_close ret:%d\n",close_ret);
    }
    else if(0 == strcmp("WRITE",cmd[2]))
    {
        char *data = cmd[3];
        int data_len = strlen(cmd[3]);
        int ret = cm_ssl_write(cm_ssl_ctx_p,data,data_len);
        cm_demo_printf("cm_ssl_write ret:%d\n",ret);
        OCTEST_FUNC_EXPECT_GREATER_OR_EQUAL_INT32(0,ret,cm_ssl_write);
    }
    else if(0 == strcmp("READ",cmd[2]))
    {
        char data[1000] = {0};
        int data_len = 999;
        int ret = cm_ssl_read(cm_ssl_ctx_p,data,data_len);
        cm_demo_printf("cm_ssl_read ret:%d\n",ret);
        cm_demo_printf("data:%s\n",data);
        OCTEST_FUNC_EXPECT_GREATER_OR_EQUAL_INT32(0,ret,cm_ssl_read);
    }
    else if(0 == strcmp("CHECK_PENDING",cmd[2]))
    {
        int ret = cm_ssl_check_pending(cm_ssl_ctx_p);
        cm_demo_printf("cm_ssl_check_pending ret:%d\n",ret);
        OCTEST_FUNC_EXPECT_EQUAL_INT32(0,ret,cm_ssl_check_pending);
    }
    else if(0 == strcmp("BYTES_AVAIL",cmd[2]))
    {
        int ret = cm_ssl_get_bytes_avail(cm_ssl_ctx_p);
        cm_demo_printf("cm_ssl_get_bytes_avail ret:%d\n",ret);
        OCTEST_FUNC_EXPECT_GREATER_OR_EQUAL_INT32(0,ret,cm_ssl_get_bytes_avail);
    }
    else{
        cm_demo_printf("param error!\n");
    }
}
